/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License Version
 *  3 as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA.
 */

#ifndef SHELL_H
#define SHELL_H

#include <QWidget>

namespace Ui {
    class shell;
}

#include <optra/common/guiwindow.h>


class QCompleter;

class Highlighter;

class Shell : public Optra::GuiWindow {
    Q_OBJECT
public:
    Shell(QWidget *parent = 0);
    ~Shell();

protected:
    void changeEvent(QEvent *e);

private slots:
    void run();
    void debug();
    void execute(bool debug);
    void reportScriptError(const QScriptValue &error);

private:
    Ui::shell *ui;
    QAbstractItemModel *modelFromFile(const QString& fileName);

    QCompleter* completer;

    QScriptEngine* engine;
    QScriptEngineDebugger  * debugger;
    QMainWindow* debugWindow;

    Highlighter* highlighter;
};

#endif // SHELL_H
